﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="News.aspx.cs" Inherits="NewsPage" Title="飞扬四方-企业动态" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <!--

Title Under Menu

-->
    <body id="News">
        <div id="pagetitle">
            企业动态</div>
        <div id="content-top-three-column">
        </div>
        <div id="content-container-three-column">
            <!--

  CONTENT SIDE 1 COLUMN

  -->
            <div id="content-side1-three-column">
                <ul class="list-of-links">
                    <li class="current">
                        <h5>
                            <a href="News.aspx">所有消息</a></h5>
                    </li>
                    <li class="current">
                        <h5>
                            <a href="Default.aspx">返回首页</a></h5>
                    </li>
                </ul>
            </div>
            <!--

  CENTER COLUMN

  -->
            <div id="content-main-three-column">
                <h1>
                    企业动态</h1>
                <hr />
                <!-- END MAIN COLUMN -->
                <asp:Panel ID="AllNewsPanel" runat="server">
                    <%--Data Source Controls--%>
                    <asp:ObjectDataSource ID="ObjectDataSourceAllNews" runat="server" SelectMethod="GetAllNews"
                        TypeName="News"></asp:ObjectDataSource>
                    <asp:GridView ID="GridViewAllNews" runat="server" AutoGenerateColumns="False" DataSourceID="ObjectDataSourceAllNews"
                        AllowPaging="True" PageSize="5" OnRowCreated="GridViewAllNews_RowCreated" BorderWidth="0"
                        BorderColor="#E5ECF9" DataKeyNames="Id" GridLines="None">
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <div class="photo-shadow">
                                        <asp:Image ID="Image2" runat="server" ImageUrl='<%# "images/" + (string)Eval("ImageUrl") %>'
                                            AlternateText='<%# (string)Eval("ImageAltText")%>' Width="200" Height="160" CssClass="photo-border photo-float-left" /></div>
                                    <h2>
                                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "News.aspx?newsId=" + (string)Eval("Id") %>'> 
                                    <%# Eval("Title").ToString()%>
                                        </asp:HyperLink>
                                    </h2>
                                    <p class="news-date">
                                        <%# Eval("Date").ToString()%>
                                    </p>
                                    <p>
                                        <%# Eval("Content").ToString().PadRight(256,' ').Substring(0, 256) %>
                                    </p>
                                    <asp:HyperLink ID="HyperLink5" runat="server" ImageUrl="images/arrow.gif" NavigateUrl='<%# "News.aspx?newsId=" + (string)Eval("Id") %>' />
                                    <asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl='<%# "News.aspx?newsId=" + (string)Eval("Id") %>'> 
                                   更多
                                    </asp:HyperLink>
                                    <hr />
                                </ItemTemplate>
                                <ItemStyle />
                            </asp:TemplateField>
                        </Columns>
                        <PagerSettings Mode="NumericFirstLast" Position="TopAndBottom" />
                    </asp:GridView>
                </asp:Panel>
                <asp:Panel ID="NewsDetailPanel" runat="server" Visible="false">
                    <asp:ObjectDataSource ID="ObjectDataSourceNewsDetails" runat="server" SelectMethod="GetNewsItem"
                        TypeName="News">
                        <SelectParameters>
                            <asp:QueryStringParameter Name="newsItemId" QueryStringField="newsId" Type="string"
                                DefaultValue="" />
                        </SelectParameters>
                    </asp:ObjectDataSource>
                    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="false" AllowPaging="false"
                        BorderWidth="0" BorderColor="#E5ECF9" DataSourceID="ObjectDataSourceNewsDetails"
                        GridLines="None">
                        <Fields>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <div class="photo-shadow">
                                        <asp:Image ID="Image2" runat="server" ImageUrl='<%# "images/" + (string)Eval("ImageUrl") %>'
                                            AlternateText='<%# (string)Eval("ImageAltText")%>' Width="180" Height="140" CssClass="photo-border" /></div>
                                    <h2>
                                        <%# Eval("Title").ToString()%>
                                    </h2>
                                    <p class="news-date">
                                        <%# Eval("Date").ToString() %>
                                    </p>
                                    <p>
                                        <%# Eval("Content").ToString()%>
                                    </p>
                                    <hr />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Fields>
                    </asp:DetailsView>
                    <a href="News.aspx">返回所有消息</a><img src="images/arrow.gif" alt="" />
                </asp:Panel>
            </div>
            <!--

  CONTENT SIDE 2 COLUMN

  -->
            <div class="clear">
            </div>
        </div>
        <div id="content-bottom-three-column">
        </div>
    </body>
</asp:Content>
